<?php

namespace App\Models\OldSystem;

class Order extends Base
{
    /**
     * 取消
     */
    const STATUS_CANCEL = -1;

    /**
     * 待发货
     */
    const STATUS_TO_BE_DELIVERED = 1;

    /**
     * 已发货
     */
    const STATUS_SHIPPED = 2;

    /**
     * 待付款
     */
    const STATUS_PENDING_PAYMENT = 3;

    protected $table = 'order';

    protected $primaryKey = 'order_id';

    /**
     * 售后订单
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function afterSale()
    {
        return $this->hasMany(Aftersale::class, 'order_id', 'order_id');
    }
}
